/*-----------------------------------------------------------------------------
	The contents of this file are subject to the Mozilla Public License
	Version 1.1 (the "License"); you may not use this file except in
	compliance with the License. You may obtain a copy of the License at
	http://www.mozilla.org/MPL/
	
	Software distributed under the License is distributed on an "AS IS"
	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
	License for the specific language governing rights and limitations
	under the License.
	
	The Original Code is Fever Framework code.
	
	The Initial Developer of the Original Code is Romain Ecarnot.
	Portions created by Initial Developer are Copyright (C) 2006
	the Initial Developer. All Rights Reserved.
	
	Contributor(s):
	
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
-----------------------------------------------------------------------------*/

/**
 * Defines available methods for FileSystem context.
 * 
 * @see fever.app.context.ContextManager
 *
 * @author Romain Ecarnot
 */
interface fever.app.context.abstract.IFileSystem
{
	/** Indicates if passed-in {@code path} is a directory or not. */
	public function isDirectory( path : String ) : Boolean;
	
	/** Creates new directory. */
	public function createDirectory( path : String) : Boolean;
	
	/** Removes passed-in directory. */
	public function deleteDirectory( path : String ) : Boolean;
	
	/** Renames passed-in directory. */
	public function renameDirectory( path : String, newpath : String ) : Boolean;
	
	/** Indicates if passed-in {@code path} is a valid file. */
	public function isFile( path : String ) : Boolean;
	
	/** Renames passed-in file. */
	public function renameFile( path : String, newpath : String ) : Boolean;
	
	/** Removes passed-in file. */
	public function deleteFile( path : String ) : Boolean; 
	
	/** Reads passed-in file content ( Binary mode is not supported ! ). */
	public function readFile ( fullQualifiedFilename : String ) : String;
	
	/** Writes text data into passed-in file ( Binary mode is not supported ! ). */
	public function writeToFile ( data : String, path : String ) : Boolean;
	
	/** Appends text data into passed-in file ( Binary mode is not supported ! ). */
	public function appendToFile ( data : String, path : String ) : Boolean;
	
	/** Indicates if filesystem is available. */
	public function isAvailable() : Boolean;
	
	/** Returns user "temporary" directory  from current system. */
	public function getTempDirectory() : String; 
	
	/** Returns current application path from current system. */
	public function getAppDirectory() : String;
	
	/** Builds and returns a correct path / filename concatenation. */
	public function getFullQualifiedFileName( directory : String, filename : String ) : String;
}